<template>
  <a-modal
    :maskClosable="false"
    :title="title"
    :width="1350"
    :bodyStyle="{
        padding: '0 24px'
      }"
    :visible="visible"
    @cancel="handleCancel"
    cancelText="关闭">
    <a-card
      :bordered="false"
      :bodyStyle="{
        padding: '10px 24px'
      }">
      <erp-report-hr-employee-list :query="query" ref="erpReportHrEmployeeList"></erp-report-hr-employee-list>
    </a-card>
    <template slot="footer">
      <a-button @click.stop="()=>{visible=false}">关闭</a-button>
    </template>
  </a-modal>
</template>

<script>

import {filterObj} from '@/utils/util';
import ErpReportHrEmployeeList from '@/views/erp/hr/report/employee/ErpReportHrEmployeeList'

export default {
  name: 'ErpHrReportEmployeeListPenetrate',
  components: {
    ErpReportHrEmployeeList
  },
  props: [],
  data() {
    return {
      visibleDetail: false,
      title: '花名册',
      queryParam: {},
      toggleSearchStatus: false,
      columns: [],
      url: {},
      dataSource: [],
      loading: false,
      ipagination: {
        current: 1,
        pageSize: 10,
        pageSizeOptions: ['10', '20', '30', '50', '100', '200'],
        showTotal: (total, range) => {
          return range[0] + '-' + range[1] + ' 共' + total + '条'
        },
        showQuickJumper: true,
        showSizeChanger: true,
        total: 0
      },
      isorter: {
        column: 'createTime',
        order: 'desc'
      },
      scrollTrigger: {x: true},
      visible: false,
      dictOptions: {},
      query: {
        gender: null,// 性别
        ageStart: null,// 年龄段
        ageEnd: null,
        highestDegree: null,//学历
        companyAgeStart: null,// 司龄
        companyAgeEnd: null
      }
    }
  },
  created() {
    // 该方法触发屏幕自适应
    this.resetScreenSize();
    this.refresh();
    // 加载数据字典信息
    this.initDictConfig();
  },
  computed: {},
  methods: {
    initDictConfig() {
    },

    getQueryParams() {
      let param = Object.assign({}, this.queryParam, this.isorter);
      param.field = this.getQueryField();
      param.pageNo = this.ipagination.current;
      param.pageSize = this.ipagination.pageSize;
      return filterObj(param);
    },
    refresh() {
      this.loading = true
    },
    open(record) {
      console.log(record);
    },
    // 弹窗打开事件
    onOpen(queryParams) {
      this.query = queryParams;
      this.visible = true;
    },
    // 触发屏幕自适应
    resetScreenSize() {
      let screenWidth = document.body.clientWidth;
      if (screenWidth < 500) {
        this.scrollTrigger = {x: 800};
      } else {
        this.scrollTrigger = {};
      }
    },
    handleCancel() {
      this.visible = false;
    },
    handleOk() {
      this.handleCancel();
    },
  }
}
</script>
<style scoped>
.ant-card-body .table-operator {
  margin-bottom: 18px;
}

.ant-table-tbody .ant-table-row td {
  padding-top: 15px;
  padding-bottom: 15px;
}

.anty-row-operator button {
  margin: 0 5px
}

.ant-btn-danger {
  background-color: #ffffff
}

.ant-modal-cust-warp {
  height: 100%
}

.ant-modal-cust-warp .ant-modal-body {
  height: calc(100% - 110px) !important;
  overflow-y: auto
}

.ant-modal-cust-warp .ant-modal-content {
  height: 90% !important;
  overflow-y: hidden
}

.anty-img-wrap {
  height: 25px;
  position: relative;
}

.anty-img-wrap > img {
  max-height: 100%;
}

</style>